import request from '@/utils/request'

// export function getRoutes() {
//   return request({
//     url: '/routes',
//     method: 'get'
//   })
// }

export function findAll() {
  return request({
    url: '/role/findAll',
    method: 'get'
  })
}

export function page(data) {
  return request({
    url: '/role/page',
    method: 'get',
    params: data
  })
}

export function create(data) {
  return request({
    url: '/role',
    method: 'post',
    data
  })
}

export function edit(data) {
  return request({
    url: '/role',
    method: 'put',
    data
  })
}

export function deleteByIds(ids) {
  return request({
    url: `/role`,
    method: 'delete',
    data: ids
  })
}
export function assignResource(id, data) {
  return request({
    url: `/role/assignResource/${id}`,
    method: 'post',
    data
  })
}
